<template>
  <div class="recharge">
    <div class="right-con">

      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="设备故障统计" name="first"></el-tab-pane>
        <el-tab-pane label="金币流水统计" name="second"></el-tab-pane>
      </el-tabs>
      <div>
        <router-view></router-view>
      </div>
    </div><!--.right-con-->
  </div><!--.recharge-->
</template>

<script type="text/ecmascript-6">
  import api from '../../assets/js/api'
  import pageCtrl from '../common/pageCtrl'

  export default {
    name: "recharge",
    data() {
      return {
        activeName: ''
      }
    },
    beforeMount: function () {
      if(this.$route.path == '/countBox/count'){
        this.activeName='first';
      }else{
        this.activeName='second'
      }
    },
    methods: {
      handleClick:function(){
        if(this.activeName=='first'){
          this.$router.push("/countBox/count");
        }else{
          this.$router.push("/countBox/countCoin");
        }
      }
    }
  }
</script>

<style scoped>
  .user {
    height: 100%;
    min-width: 1200px;
  }
  .router-link-exact-active.router-link-active{
    color:#20a0ff;
  }
  .router-link-exact-active.router-link-active:after{
    content: '';
    position:absolute;
    width: 100%;
    height:3px;
    left:0;
    bottom:0;
    background: #20a0ff;
  }

</style>

